home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / MOR55SRC.ZIP / MORIA / SOURCE / EXTERNS.H < prev    next >
C/C++ Source or Header  |  1992-12-07  |  30KB  |  1,292 lines

  1. /* source/externs.h: declarations for global variables and initialized data
  2.  
  3.    Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke
  4.  
  5.    This software may be copied and distributed for educational, research, and
  6.    not for profit purposes provided that this copyright and statement are
  7.    included in all such copies. */
  8.  
  9. /* VMS requires that this be in externs.h, not files.c; this prevents a
  10.    'psect' error for the variable errno */
  11. #include <errno.h>
  12.  
  13. /* Atari TC requires prototypes, but does not have __STDC__.
  14.    Hence, we check for ATARIST_TC here, and define LINT_ARGS if true.  */
  15. #ifdef ATARIST_TC
  16. #define LINT_ARGS
  17. #endif
  18.  
  19. /* This causes more trouble than it is worth, and very few systems still
  20.    have this bug in their include files.  */
  21. #if 0
  22. /* many systems don't define these anywhere */
  23. #ifndef NeXT
  24. #ifndef AMIGA
  25. #if !defined(atarist) || !defined(__GNUC__)
  26. #ifndef __TURBOC__
  27. #if defined(USG) || defined(DGUX)
  28. extern int sprintf();
  29. #else
  30. extern char *sprintf();
  31. #endif
  32. #endif
  33. #endif
  34. #endif
  35. #endif
  36. #endif
  37.  
  38. /* to avoid 'psect' problem with VMS declaration of errno */
  39. #ifndef VMS
  40. extern int errno;
  41. #endif
  42.  
  43. extern char *copyright[5];
  44.  
  45. /* horrible hack: needed because compact_monster() can be called from deep
  46.    within creatures() via place_monster() and summon_monster() */
  47. extern int hack_monptr;
  48.  
  49. extern vtype died_from;
  50. extern vtype savefile;            /* The save file. -CJS- */
  51. extern int32 birth_date;
  52.  
  53. /* These are options, set with set_options command -CJS- */
  54. extern int rogue_like_commands;
  55. extern int find_cut;            /* Cut corners on a run */
  56. extern int find_examine;        /* Check corners on a run */
  57. extern int find_prself;            /* Print yourself on a run (slower) */
  58. extern int find_bound;            /* Stop run when the map shifts */
  59. extern int prompt_carry_flag;        /* Prompt to pick something up */
  60. extern int show_weight_flag;        /* Display weights in inventory */
  61. extern int highlight_seams;        /* Highlight magma and quartz */
  62. extern int find_ignore_doors;        /* Run through open doors */
  63. extern int sound_beep_flag;        /* Beep for invalid character */
  64. extern int display_counts;        /* Display rest/repeat counts */
  65.  
  66. /* global flags */
  67. extern int new_level_flag;      /* Next level when true  */
  68. extern int teleport_flag;    /* Handle teleport traps  */
  69. extern int eof_flag;        /* Used to handle eof/HANGUP */
  70. extern int player_light;      /* Player carrying light */
  71. extern int find_flag;    /* Used in MORIA          */
  72. extern int free_turn_flag;    /* Used in MORIA          */
  73. extern int weapon_heavy;    /* Flag if the weapon too heavy -CJS- */
  74. extern int pack_heavy;        /* Flag if the pack too heavy -CJS- */
  75. extern char doing_inven;    /* Track inventory commands */
  76. extern int screen_change;    /* Screen changes (used in inven_commands) */
  77.  
  78. extern int character_generated;     /* don't save score until char gen finished*/
  79. extern int character_saved;     /* prevents save on kill after save_char() */
  80. #if defined(STDIO_LOADED)
  81. extern FILE *highscore_fp;    /* High score file pointer */
  82. #endif
  83. extern int command_count;    /* Repetition of commands. -CJS- */
  84. extern int default_dir;        /* Use last direction in repeated commands */
  85. extern int16 noscore;        /* Don't score this game. -CJS- */
  86. extern int32u randes_seed;    /* For encoding colors */
  87. extern int32u town_seed;        /* Seed for town genera*/
  88. extern int16 dun_level;    /* Cur dungeon level   */
  89. extern int16 missile_ctr;    /* Counter for missiles */
  90. extern int msg_flag;    /* Set with first msg  */
  91. extern vtype old_msg[MAX_SAVE_MSG];    /* Last messages -CJS- */
  92. extern int16 last_msg;            /* Where in the array is the last */
  93. extern int death;    /* True if died          */
  94. extern int32 turn;    /* Cur trun of game    */
  95. extern int wizard;    /* Wizard flag          */
  96. extern int to_be_wizard;
  97. extern int16 panic_save; /* this is true if playing from a panic save */
  98.  
  99. extern int wait_for_more;
  100.  
  101. extern char days[7][29];
  102. extern int closing_flag;    /* Used for closing   */
  103.  
  104. extern int16 cur_height, cur_width;    /* Cur dungeon size    */
  105. /*  Following are calculated from max dungeon sizes        */
  106. extern int16 max_panel_rows, max_panel_cols;
  107. extern int panel_row, panel_col;
  108. extern int panel_row_min, panel_row_max;
  109. extern int panel_col_min, panel_col_max;
  110. extern int panel_col_prt, panel_row_prt;
  111.  
  112. /*  Following are all floor definitions                */
  113. #ifdef MAC
  114. extern cave_type (*cave)[MAX_WIDTH];
  115. #else
  116. extern cave_type cave[MAX_HEIGHT][MAX_WIDTH];
  117. #endif
  118.  
  119. /* Following are player variables                */
  120. extern player_type py;
  121. #ifdef MACGAME
  122. extern char *(*player_title)[MAX_PLAYER_LEVEL];
  123. extern race_type *race;
  124. extern background_type *background;
  125. #else
  126. extern char *player_title[MAX_CLASS][MAX_PLAYER_LEVEL];
  127. extern race_type race[MAX_RACES];
  128. extern background_type background[MAX_BACKGROUND];
  129. #endif
  130. extern int32u player_exp[MAX_PLAYER_LEVEL];
  131. extern int16u player_hp[MAX_PLAYER_LEVEL];
  132. extern int16 char_row;
  133. extern int16 char_col;
  134.  
  135. extern int8u rgold_adj[MAX_RACES][MAX_RACES];
  136.  
  137. extern class_type class[MAX_CLASS];
  138. extern int16 class_level_adj[MAX_CLASS][MAX_LEV_ADJ];
  139.  
  140. /* Warriors don't have spells, so there is no entry for them. */
  141. #ifdef MACGAME
  142. extern spell_type (*magic_spell)[31];
  143. #else
  144. extern spell_type magic_spell[MAX_CLASS-1][31];
  145. #endif
  146. extern char *spell_names[62];
  147. extern int32u spell_learned;    /* Bit field for spells learnt -CJS- */
  148. extern int32u spell_worked;    /* Bit field for spells tried -CJS- */
  149. extern int32u spell_forgotten;    /* Bit field for spells forgotten -JEW- */
  150. extern int8u spell_order[32];    /* remember order that spells are learned in */
  151. extern int16u player_init[MAX_CLASS][5];
  152. extern int16 total_winner;
  153. extern int32 max_score;
  154.  
  155. /* Following are store definitions                */
  156. #ifdef MACGAME
  157. extern owner_type *owners;
  158. #else
  159. extern owner_type owners[MAX_OWNERS];
  160. #endif
  161. #ifdef MAC
  162. extern store_type *store;
  163. #else
  164. extern store_type store[MAX_STORES];
  165. #endif
  166. extern int16u store_choice[MAX_STORES][STORE_CHOICES];
  167. #ifndef MAC
  168. extern int (*store_buy[MAX_STORES])();
  169. #endif
  170.  
  171. /* Following are treasure arrays    and variables            */
  172. #ifdef MACGAME
  173. extern treasure_type *object_list;
  174. #else
  175. extern treasure_type object_list[MAX_OBJECTS];
  176. #endif
  177. extern int8u object_ident[OBJECT_IDENT_SIZE];
  178. extern int16 t_level[MAX_OBJ_LEVEL+1];
  179. extern inven_type t_list[MAX_TALLOC];
  180. extern inven_type inventory[INVEN_ARRAY_SIZE];
  181. extern char *special_names[SN_ARRAY_SIZE];
  182. extern int16 sorted_objects[MAX_DUNGEON_OBJ];
  183. extern int16 inven_ctr;        /* Total different obj's    */
  184. extern int16 inven_weight;    /* Cur carried weight    */
  185. extern int16 equip_ctr;    /* Cur equipment ctr    */
  186. extern int16 tcptr;    /* Cur treasure heap ptr    */
  187.  
  188. /* Following are creature arrays and variables            */
  189. #ifdef MACGAME
  190. extern creature_type *c_list;
  191. #else
  192. extern creature_type c_list[MAX_CREATURES];
  193. #endif
  194. extern monster_type m_list[MAX_MALLOC];
  195. extern int16 m_level[MAX_MONS_LEVEL+1];
  196. extern m_attack_type monster_attacks[N_MONS_ATTS];
  197. #ifdef MAC
  198. extern recall_type *c_recall;
  199. #else
  200. extern recall_type c_recall[MAX_CREATURES];    /* Monster memories. -CJS- */
  201. #endif
  202. extern monster_type blank_monster;    /* Blank monster values    */
  203. extern int16 mfptr;    /* Cur free monster ptr    */
  204. extern int16 mon_tot_mult;    /* # of repro's of creature    */
  205.  
  206. /* Following are arrays for descriptive pieces            */
  207. #ifdef MACGAME
  208. extern char **colors;
  209. extern char **mushrooms;
  210. extern char **woods;
  211. extern char **metals;
  212. extern char **rocks;
  213. extern char **amulets;
  214. extern char **syllables;
  215. #else
  216. extern char *colors[MAX_COLORS];
  217. extern char *mushrooms[MAX_MUSH];
  218. extern char *woods[MAX_WOODS];
  219. extern char *metals[MAX_METALS];
  220. extern char *rocks[MAX_ROCKS];
  221. extern char *amulets[MAX_AMULETS];
  222. extern char *syllables[MAX_SYLLABLES];
  223. #endif
  224.  
  225. extern int8u blows_table[7][6];
  226.  
  227. extern int16u normal_table[NORMAL_TABLE_SIZE];
  228.  
  229. /* Initialized data which had to be moved from some other file */
  230. /* Since these get modified, macrsrc.c must be able to access them */
  231. /* Otherwise, game cannot be made restartable */
  232. /* dungeon.c */
  233. extern char last_command;  /* Memory of previous command. */
  234. /* moria1.c */
  235. /* Track if temporary light about player.  */
  236. extern int light_flag;
  237.  
  238. #ifdef MSDOS
  239. extern int8u    floorsym, wallsym;
  240. extern int    ansi, saveprompt;
  241. extern char    moriatop[], moriasav[];
  242. #endif
  243.  
  244. /* function return values */
  245. /* only extern functions declared here, static functions declared inside
  246.    the file that defines them */
  247. #if defined(LINT_ARGS)
  248. /* these prototypes can be used by MSC and TC for type checking of arguments
  249.    WARNING: note that this does not work for all ANSI C compilers, e.g. Gnu C,
  250.    will give error messages if you use these prototypes.
  251.    This is due to differing interpretations of the ANSI C standard,
  252.    specifically how to handle promotion of parameters.  In my reading of
  253.    the standard, I believe that Gnu C's behaviour is correct.  */
  254.  
  255. #ifdef ATARI_ST
  256. /* atarist.c */
  257. int check_input(int microsec);
  258. void user_name(char * buf);
  259. int access(char * name, int dum);
  260. void chmod(char * name, int mode); /* dummy function */
  261. #endif
  262.  
  263. /* create.c */
  264. void create_character(void);
  265.  
  266. /* creature.c */
  267. void update_mon(int);
  268. int multiply_monster(int, int, int, int);
  269. void creatures(int);
  270.  
  271. /* death.c */
  272. void display_scores(int);
  273. int duplicate_character(void);
  274. int32 total_points(void);
  275. void exit_game(void);
  276.  
  277. /* desc.c */
  278. int is_a_vowel(char);
  279. void magic_init(void);
  280. int16 object_offset(struct inven_type *);
  281. void known1(struct inven_type *);
  282. int known1_p(struct inven_type *);
  283. void known2(struct inven_type *);
  284. int known2_p(struct inven_type *);
  285. void clear_known2(struct inven_type *);
  286. void clear_empty(inven_type *);
  287. void store_bought(inven_type *);
  288. int store_bought_p(inven_type *);
  289. void sample(struct inven_type *);
  290. void identify(int *);
  291. void unmagic_name(struct inven_type *);
  292. void objdes(char *, struct inven_type *, int);
  293. void invcopy(inven_type *, int);
  294. void desc_charges(int);
  295. void desc_remain(int);
  296.  
  297. /* dungeon.c */
  298. void dungeon(void);
  299.  
  300. /* eat.c */
  301. void eat(void);
  302.  
  303. /* files.c */
  304. void init_scorefile(void);
  305. void read_times(void);
  306. void helpfile(char *);
  307. void print_objects(void);
  308. #ifdef MAC
  309. int file_character(void);
  310. #else
  311. int file_character(char *);
  312. #endif
  313.  
  314. /* generate.c */
  315. void generate_cave(void);
  316.  
  317. #ifdef VMS
  318. /* getch.c */
  319. int kbhit (void);
  320. void user_name (char *);
  321. void vms_crmode (void);
  322. void vms_nocrmode (void);
  323. int opengetch (void);
  324. int closegetch (void);
  325. char vms_getch (void);
  326. #endif
  327.  
  328. /* help.c */
  329. void ident_char(void);
  330.  
  331. /* io.c */
  332. #ifdef SIGTSTP
  333. int suspend(void);
  334. #endif
  335. void init_curses(void);
  336. void moriaterm(void);
  337. void put_buffer(char *, int, int);
  338. void put_qio(void);
  339. void restore_term(void);
  340. void shell_out(void);
  341. char inkey(void);
  342. void flush(void);
  343. void erase_line(int, int);
  344. void clear_screen(void);
  345. void clear_from(int);
  346. void print(char, int, int);
  347. void move_cursor_relative(int, int);
  348. void count_msg_print(char *);
  349. void prt(char *, int, int);
  350. void move_cursor(int, int);
  351. void msg_print(char *);
  352. int get_check(char *);
  353. int get_com(char *, char *);
  354. int get_string(char *, int, int, int);
  355. void pause_line(int);
  356. void pause_exit(int, int);
  357. void save_screen(void);
  358. void restore_screen(void);
  359. void bell(void);
  360. void screen_map(void);
  361.  
  362. /* magic.c */
  363. void cast(void);
  364.  
  365. /* main.c */
  366. int main(int, char **);
  367.  
  368. /* misc1.c */
  369. void init_seeds(int32u);
  370. void set_seed(int32u);
  371. void reset_seed(void);
  372. int check_time(void);
  373. int randint(int);
  374. int randnor(int, int);
  375. int bit_pos(int32u *);
  376. int in_bounds(int, int);
  377. void panel_bounds(void);
  378. int get_panel(int, int, int);
  379. int panel_contains(int, int);
  380. int distance(int, int, int, int);
  381. int next_to_wall(int, int);
  382. int next_to_corr(int, int);
  383. int damroll(int, int);
  384. int pdamroll(unsigned char *);
  385. int los(int, int, int, int);
  386. unsigned char loc_symbol(int, int);
  387. int test_light(int, int);
  388. void prt_map(void);
  389. int compact_monsters(void);
  390. void add_food(int);
  391. int popm(void);
  392. int max_hp(unsigned char *);
  393. int place_monster(int, int, int, int);
  394. void place_win_monster(void);
  395. int get_mons_num(int);
  396. void alloc_monster(int, int, int);
  397. int summon_monster(int * ,int *, int);
  398. int summon_undead(int *, int *);
  399. int popt(void);
  400. void pusht(int8u);
  401. int magik(int);
  402. int m_bonus(int, int, int);
  403.  
  404. /* misc2.c */
  405. void magic_treasure(int, int);
  406. void set_options(void);
  407.  
  408. /* misc3.c */
  409. void place_trap(int, int, int);
  410. void place_rubble(int, int);
  411. void place_gold(int, int);
  412. int get_obj_num(int);
  413. void place_object(int, int);
  414. void alloc_object(int (*)(), int, int);
  415. void random_object(int, int, int);
  416. void cnv_stat(int8u, char *);
  417. void prt_stat(int);
  418. void prt_field(char *, int, int);
  419. int stat_adj(int);
  420. int chr_adj(void);
  421. int con_adj(void);
  422. char *title_string(void);
  423. void prt_title(void);
  424. void prt_level(void);
  425. void prt_cmana(void);
  426. void prt_mhp(void);
  427. void prt_chp(void);
  428. void prt_pac(void);
  429. void prt_gold(void);
  430. void prt_depth(void);
  431. void prt_hunger(void);
  432. void prt_blind(void);
  433. void prt_confused(void);
  434. void prt_afraid(void);
  435. void prt_poisoned(void);
  436. void prt_state(void);
  437. void prt_speed(void);
  438. void prt_study(void);
  439. void prt_winner(void);
  440. int8u modify_stat(int, int16);
  441. void set_use_stat(int);
  442. int inc_stat(int);
  443. int dec_stat(int);
  444. int res_stat(int);
  445. void bst_stat(int, int);
  446. int tohit_adj(void);
  447. int toac_adj(void);
  448. int todis_adj(void);
  449. int todam_adj(void);
  450. void prt_stat_block(void);
  451. void draw_cave(void);
  452. void put_character(void);
  453. void put_stats(void);
  454. char *likert(int, int);
  455. void put_misc1(void);
  456. void put_misc2(void);
  457. void put_misc3(void);
  458. void display_char(void);
  459. void get_name(void);
  460. void change_name(void);
  461. void inven_destroy(int);
  462. void take_one_item(struct inven_type *, struct inven_type *);
  463. void inven_drop(int, int);
  464. int inven_damage(int (*)(), int);
  465. int weight_limit(void);
  466. int inven_check_num(struct inven_type *);
  467. int inven_check_weight(struct inven_type *);
  468. void check_strength(void);
  469. int inven_carry(struct inven_type *);
  470. int spell_chance(int);
  471. void print_spells(int *, int, int, int);
  472. int get_spell(int *, int, int *, int *, char *, int);
  473. void calc_spells(int);
  474. void gain_spells(void);
  475. void calc_mana(int);
  476. void prt_experience(void);
  477. void calc_hitpoints(void);
  478. void insert_str(char *, char *, char *);
  479. void insert_lnum(char *, char *, int32, int);
  480. int enter_wiz_mode(void);
  481. int attack_blows(int, int *);
  482. int tot_dam(struct inven_type *, int, int);
  483. int critical_blow(int, int, int, int);
  484. int mmove(int, int *, int *);
  485. int player_saves(void);
  486. int find_range(int, int, int *, int *);
  487. void teleport(int);
  488.  
  489. /* misc4.c */
  490. void scribe_object(void);
  491. void add_inscribe(struct inven_type *, int8u);
  492. void inscribe(struct inven_type *, char *);
  493. void check_view(void);
  494.  
  495. /* monsters.c */
  496.  
  497. /* moria1.c */
  498. void change_speed(int);
  499. void py_bonuses(struct inven_type *, int);
  500. void calc_bonuses(void);
  501. int show_inven(int, int, int, int, char *);
  502. char *describe_use(int);
  503. int show_equip(int, int);
  504. void takeoff(int, int);
  505. int verify(char *, int);
  506. void inven_command(char);
  507. int get_item(int *, char *, int, int, char *, char *);
  508. int no_light(void);
  509. int get_dir(char *, int *);
  510. int get_alldir(char *, int *);
  511. void move_rec(int, int, int, int);
  512. void light_room(int, int);
  513. void lite_spot(int, int);
  514. void move_light(int, int, int, int);
  515. void disturb(int, int);
  516. void search_on(void);
  517. void search_off(void);
  518. void rest(void);
  519. void rest_off(void);
  520. int test_hit(int, int, int, int, int);
  521. void take_hit(int, char *);
  522.  
  523. /* moria2.c */
  524. void change_trap(int, int);
  525. void search(int, int, int);
  526. void find_init(int);
  527. void find_run(void);
  528. void end_find(void);
  529. void area_affect(int, int, int);
  530. int minus_ac(int32u);
  531. void corrode_gas(char *);
  532. void poison_gas(int, char *);
  533. void fire_dam(int, char *);
  534. void cold_dam(int, char *);
  535. void light_dam(int, char *);
  536. void acid_dam(int, char *);
  537.  
  538. /* moria3.c */
  539. int cast_spell(char * ,int, int *, int *);
  540. void delete_monster(int);
  541. void fix1_delete_monster(int);
  542. void fix2_delete_monster(int);
  543. int delete_object(int, int);
  544. int32u monster_death(int, int, int32u);
  545. int mon_take_hit(int, int);
  546. void py_attack(int, int);
  547. void move_char(int, int);
  548. void chest_trap(int, int);
  549. void openobject(void);
  550. void closeobject(void);
  551. int twall(int, int, int, int);
  552.  
  553. /* moria4.c */
  554. void tunnel(int);
  555. void disarm_trap(void);
  556. void look(void);
  557. void throw_object(void);
  558. void bash(void);
  559.  
  560. #ifdef MSDOS
  561. /* ms_misc.c */
  562. void user_name(char *);
  563. char *getlogin(void);
  564. #ifdef __TURBOC__
  565. void sleep(unsigned);
  566. #else
  567. unsigned int sleep(int);
  568. #endif
  569. void error(char *, ...);
  570. void warn(char *, ...);
  571. void msdos_init(void);
  572. void msdos_raw(void);
  573. void msdos_noraw(void);
  574. int bios_getch(void);
  575. int msdos_getch(void);
  576. void bios_clear(void);
  577. void msdos_intro(void);
  578. void bios_clear(void);
  579. #endif
  580.  
  581. /* potions.c */
  582. void quaff(void);
  583.  
  584. /* prayer.c */
  585. void pray(void);
  586.  
  587. /* recall.c */
  588. int bool_roff_recall(int);
  589. int roff_recall(int);
  590.  
  591. /* rnd.c */
  592. int32u get_rnd_seed(void);
  593. void set_rnd_seed(int32u);
  594. int32 rnd(void);
  595.  
  596. /* save.c */
  597. #ifdef MAC
  598. int save_char(int);
  599. #else
  600. int save_char(void);
  601. #endif
  602. int _save_char(char *);
  603. int get_char(int *);
  604. #if defined(STDIO_LOADED)
  605. void set_fileptr(FILE *);
  606. #endif
  607. void wr_highscore(high_scores *);
  608. void rd_highscore(high_scores *);
  609.  
  610. /* scrolls.c */
  611. void read_scroll(void);
  612.  
  613. /* sets.c */
  614. int set_room(int);
  615. int set_corr(int);
  616. int set_floor(int);
  617. int set_corrodes(inven_type *);
  618. int set_flammable(inven_type *);
  619. int set_frost_destroy(inven_type *);
  620. int set_acid_affect(inven_type *);
  621. int set_lightning_destroy(inven_type *);
  622. int set_null(inven_type *);
  623. int set_acid_destroy(inven_type *);
  624. int set_fire_destroy(inven_type *);
  625. int general_store(int);
  626. int armory(int);
  627. int weaponsmith(int);
  628. int temple(int);
  629. int alchemist(int);
  630. int magic_shop(int);
  631. #ifdef MAC
  632. int store_buy(int, int);
  633. #endif
  634.  
  635. /* signals.c */
  636. void nosignals(void);
  637. void signals(void);
  638. void init_signals(void);
  639. void ignore_signals(void);
  640. void default_signals(void);
  641. void restore_signals(void);
  642.  
  643. /* spells.c */
  644. void monster_name(char *, struct monster_type *, struct creature_type *);
  645. void lower_monster_name(char *, struct monster_type *,
  646.             struct creature_type *);
  647. int sleep_monsters1(int, int);
  648. int detect_treasure(void);
  649. int detect_object(void);
  650. int detect_trap(void);
  651. int detect_sdoor(void);
  652. int detect_invisible(void);
  653. int light_area(int, int);
  654. int unlight_area(int, int);
  655. void map_area(void);
  656. int ident_spell(void);
  657. int aggravate_monster(int);
  658. int trap_creation(void);
  659. int door_creation(void);
  660. int td_destroy(void);
  661. int detect_monsters(void);
  662. void light_line(int, int, int);
  663. void starlite(int, int);
  664. int disarm_all(int, int, int);
  665. void get_flags(int, int32u *, int *, int (**)());
  666. void fire_bolt(int, int, int, int, int, char *);
  667. void fire_ball(int, int, int, int, int, char *);
  668. void breath(int, int, int, int, char *, int);
  669. int recharge(int);
  670. int hp_monster(int, int, int, int);
  671. int drain_life(int, int, int);
  672. int speed_monster(int, int, int, int);
  673. int confuse_monster(int, int, int);
  674. int sleep_monster(int, int, int);
  675. int wall_to_mud(int, int, int);
  676. int td_destroy2(int, int, int);
  677. int poly_monster(int, int, int);
  678. int build_wall(int, int, int);
  679. int clone_monster(int, int, int);
  680. void teleport_away(int, int);
  681. void teleport_to(int, int);
  682. int teleport_monster(int, int, int);
  683. int mass_genocide(void);
  684. int genocide(void);
  685. int speed_monsters(int);
  686. int sleep_monsters2(void);
  687. int mass_poly(void);
  688. int detect_evil(void);
  689. int hp_player(int);
  690. int cure_confusion(void);
  691. int cure_blindness(void);
  692. int cure_poison(void);
  693. int remove_fear(void);
  694. void earthquake(void);
  695. int protect_evil(void);
  696. void create_food(void);
  697. int dispel_creature(int, int);
  698. int turn_undead(void);
  699. void warding_glyph(void);
  700. void lose_str(void);
  701. void lose_int(void);
  702. void lose_wis(void);
  703. void lose_dex(void);
  704. void lose_con(void);
  705. void lose_chr(void);
  706. void lose_exp(int32);
  707. int slow_poison(void);
  708. void bless(int);
  709. void detect_inv2(int);
  710. void destroy_area(int, int);
  711. int enchant(int16 *, int16);
  712. int remove_curse(void);
  713. int restore_level(void);
  714.  
  715. /* staffs.c */
  716. void use(void);
  717.  
  718. /* store1.c */
  719. int32 item_value(struct inven_type *);
  720. int32 sell_price(int, int32 *, int32 *, struct inven_type *);
  721. int store_check_num(struct inven_type *, int);
  722. void store_carry(int, int *, struct inven_type *);
  723. void store_destroy(int, int, int);
  724. void store_init(void);
  725. void store_maint(void);
  726. int noneedtobargain(int, int32);
  727. void updatebargain(int, int32, int32);
  728.  
  729. /* store2.c */
  730. void enter_store(int);
  731.  
  732. /* treasur1.c */
  733.  
  734. /* treasur2.c */
  735.  
  736. #ifdef VMS
  737. /* uexit.c */
  738. void uexit (int);
  739. #endif
  740.  
  741. #ifdef unix
  742. /* unix.c */
  743. int check_input(int);
  744. #if 0
  745. int system_cmd(char *);
  746. #endif
  747. void user_name(char *);
  748. int tilde(char *, char *);
  749. /* only declare this if stdio.h has been previously included, STDIO_LOADED
  750.    is defined after stdio.h is included */
  751. #if defined(STDIO_LOADED)
  752. FILE *tfopen(char *, char *);
  753. #endif
  754. int topen(char *, int, int);
  755. #endif
  756.  
  757. /* variable.c */
  758.  
  759. /* wands.c */
  760. void aim(void);
  761.  
  762. /* wizard.c */
  763. void wizard_light(void);
  764. void change_character(void);
  765. void wizard_create(void);
  766.  
  767. #else
  768. /* !defined (LINT_ARGS) */
  769.  
  770. #ifdef ATARI_ST
  771. /* atarist.c */
  772. int check_input ();
  773. void user_name ();
  774. int access ();
  775. void chmod ();
  776. #endif
  777.  
  778. /* create.c */
  779. void create_character();
  780.  
  781. /* creature.c */
  782. void update_mon();
  783. int multiply_monster();
  784. void creatures();
  785.  
  786. /* death.c */
  787. void display_scores();
  788. int duplicate_character();
  789. int32 total_points();
  790. void exit_game();
  791.  
  792. /* desc.c */
  793. int is_a_vowel();
  794. void magic_init();
  795. int16 object_offset();
  796. void known1();
  797. int known1_p();
  798. void known2();
  799. int known2_p();
  800. void clear_known2();
  801. void clear_empty();
  802. void store_bought();
  803. int store_bought_p();
  804. void sample();
  805. void identify();
  806. void unmagic_name();
  807. void objdes();
  808. void invcopy();
  809. void desc_charges();
  810. void desc_remain();
  811.  
  812. /* dungeon.c */
  813. void dungeon();
  814.  
  815. /* eat.c */
  816. void eat();
  817.  
  818. /* files.c */
  819. void init_scorefile();
  820. void read_times();
  821. void helpfile();
  822. void print_objects();
  823. int file_character();
  824.  
  825. /* generate.c */
  826. void generate_cave();
  827.  
  828. #ifdef VMS
  829. /* getch.c */
  830. int kbhit ();
  831. void user_name ();
  832. void vms_crmode ();
  833. void vms_nocrmode ();
  834. int opengetch ();
  835. int closegetch ();
  836. char vms_getch ();
  837. #endif
  838.  
  839. /* help.c */
  840. void ident_char();
  841.  
  842. /* io.c */
  843. #ifdef SIGTSTP
  844. int suspend();
  845. #endif
  846. void init_curses();
  847. void moriaterm();
  848. void put_buffer();
  849. void put_qio();
  850. void restore_term();
  851. void shell_out();
  852. char inkey();
  853. void flush();
  854. void erase_line();
  855. void clear_screen();
  856. void clear_from();
  857. void print();
  858. void move_cursor_relative();
  859. void count_msg_print();
  860. void prt();
  861. void move_cursor();
  862. void msg_print();
  863. int get_check();
  864. int get_com();
  865. int get_string();
  866. void pause_line();
  867. void pause_exit();
  868. void save_screen();
  869. void restore_screen();
  870. void bell();
  871. void screen_map();
  872.  
  873. /* magic.c */
  874. void cast();
  875.  
  876. /* main.c */
  877. int main();
  878.  
  879. /* misc1.c */
  880. void init_seeds();
  881. void set_seed();
  882. void reset_seed();
  883. int check_time();
  884. int randint();
  885. int randnor();
  886. int bit_pos();
  887. int in_bounds();
  888. void panel_bounds();
  889. int get_panel();
  890. int panel_contains();
  891. int distance();
  892. int next_to_walls();
  893. int next_to_corr();
  894. int damroll();
  895. int pdamroll();
  896. int los();
  897. unsigned char loc_symbol();
  898. int test_light();
  899. void prt_map();
  900. int compact_monsters();
  901. void add_food();
  902. int popm();
  903. int max_hp();
  904. int place_monster();
  905. void place_win_monster();
  906. int get_mons_num();
  907. void alloc_monster();
  908. int summon_monster();
  909. int summon_undead();
  910. int popt();
  911. void pusht();
  912. int magik();
  913. int m_bonus();
  914.  
  915. /* misc2.c */
  916. void magic_treasure();
  917. void set_options();
  918.  
  919. /* misc3.c */
  920. void place_trap();
  921. void place_rubble();
  922. void place_gold();
  923. int get_obj_num();
  924. void place_object();
  925. void alloc_object();
  926. void random_object();
  927. void cnv_stat();
  928. void prt_stat();
  929. void prt_field();
  930. int stat_adj();
  931. int chr_adj();
  932. int con_adj();
  933. char *title_string();
  934. void prt_title();
  935. void prt_level();
  936. void prt_cmana();
  937. void prt_mhp();
  938. void prt_chp();
  939. void prt_pac();
  940. void prt_gold();
  941. void prt_depth();
  942. void prt_hunger();
  943. void prt_blind();
  944. void prt_confused();
  945. void prt_afraid();
  946. void prt_poisoned();
  947. void prt_state();
  948. void prt_speed();
  949. void prt_study();
  950. void prt_winner();
  951. int8u modify_stat();
  952. void set_use_stat();
  953. int inc_stat();
  954. int dec_stat();
  955. int res_stat();
  956. void bst_stat();
  957. int tohit_adj();
  958. int toac_adj();
  959. int todis_adj();
  960. int todam_adj();
  961. void prt_stat_block();
  962. void draw_cave();
  963. void put_character();
  964. void put_stats();
  965. char *likert();
  966. void put_misc1();
  967. void put_misc2();
  968. void put_misc3();
  969. void display_char();
  970. void get_name();
  971. void change_name();
  972. void inven_destroy();
  973. void take_one_item();
  974. void inven_drop();
  975. int inven_damage();
  976. int weight_limit();
  977. int inven_check_num();
  978. int inven_check_weight();
  979. void check_strength();
  980. int inven_carry();
  981. int spell_chance();
  982. void print_spells();
  983. int get_spell();
  984. void calc_spells();
  985. void gain_spells();
  986. void calc_mana();
  987. void prt_experience();
  988. void calc_hitpoints();
  989. void insert_str();
  990. void insert_lnum();
  991. int enter_wiz_mode();
  992. int attack_blows();
  993. int tot_dam();
  994. int critical_blow();
  995. int mmove();
  996. int player_saves();
  997. int find_range();
  998. void teleport();
  999.  
  1000. /* misc4.c */
  1001. void scribe_object();
  1002. void add_inscribe();
  1003. void inscribe();
  1004. void check_view();
  1005.  
  1006. /* monsters.c */
  1007.  
  1008. /* moria1.c */
  1009. void change_speed();
  1010. void py_bonuses();
  1011. void calc_bonuses();
  1012. int show_inven();
  1013. char *describe_use();
  1014. int show_equip();
  1015. void takeoff();
  1016. int verify();
  1017. void inven_command();
  1018. int get_item();
  1019. int no_light();
  1020. int get_dir();
  1021. int get_alldir();
  1022. void move_rec();
  1023. void light_room();
  1024. void lite_spot();
  1025. void move_light();
  1026. void disturb();
  1027. void search_on();
  1028. void search_off();
  1029. void rest();
  1030. void rest_off();
  1031. int test_hit();
  1032. void take_hit();
  1033.  
  1034. /* moria2.c */
  1035. void change_trap();
  1036. void search();
  1037. void find_init();
  1038. void find_run();
  1039. void end_find();
  1040. void area_affect();
  1041. int minus_ac();
  1042. void corrode_gas();
  1043. void poison_gas();
  1044. void fire_dam();
  1045. void cold_dam();
  1046. void light_dam();
  1047. void acid_dam();
  1048.  
  1049. /* moria3.c */
  1050. int cast_spell();
  1051. void delete_monster();
  1052. void fix1_delete_monster();
  1053. void fix2_delete_monster();
  1054. int delete_object();
  1055. int32u monster_death();
  1056. int mon_take_hit();
  1057. void py_attack();
  1058. void move_char();
  1059. void chest_trap();
  1060. void openobject();
  1061. void closeobject();
  1062. int twall();
  1063.  
  1064. /* moria4.c */
  1065. void tunnel();
  1066. void disarm_trap();
  1067. void look();
  1068. void throw_object();
  1069. void bash();
  1070.  
  1071. #ifdef MSDOS
  1072. /* ms_misc.c */
  1073. void user_name();
  1074. char *getlogin();
  1075. #ifdef __TURBOC__
  1076. void sleep();
  1077. #else
  1078. unsigned int sleep();
  1079. #endif
  1080. #if 0
  1081. void error();
  1082. void warn();
  1083. #else
  1084. /* Because an empty parameter list in a declaration can not match a parameter
  1085.    list with an elipsis in a definition.  */
  1086. void error (char *fmt, ...);
  1087. void warn (char *fmt, ...);
  1088. #endif
  1089. void msdos_init();
  1090. void msdos_raw();
  1091. void msdos_noraw();
  1092. int bios_getch();
  1093. int msdos_getch();
  1094. void bios_clear();
  1095. void msdos_intro();
  1096. void bios_clear();
  1097. #endif
  1098.  
  1099. /* potions.c */
  1100. void quaff();
  1101.  
  1102. /* prayer.c */
  1103. void pray();
  1104.  
  1105. /* recall.c */
  1106. int bool_roff_recall();
  1107. int roff_recall();
  1108.  
  1109. /* rnd.c */
  1110. int32u get_rnd_seed();
  1111. void set_rnd_seed();
  1112. int32 rnd();
  1113.  
  1114. /* save.c */
  1115. int save_char();
  1116. int _save_char();
  1117. int get_char();
  1118. #if defined(STDIO_LOADED)
  1119. void set_fileptr();
  1120. #endif
  1121. void wr_highscore();
  1122. void rd_highscore();
  1123.  
  1124. /* scrolls.c */
  1125. void read_scroll();
  1126.  
  1127. /* sets.c */
  1128. int set_room();
  1129. int set_corr();
  1130. int set_floor();
  1131. int set_corrodes();
  1132. int set_flammable();
  1133. int set_frost_destroy();
  1134. int set_acid_affect();
  1135. int set_lightning_destroy();
  1136. int set_null();
  1137. int set_acid_destroy();
  1138. int set_fire_destroy();
  1139. int general_store();
  1140. int armory();
  1141. int weaponsmith();
  1142. int temple();
  1143. int alchemist();
  1144. int magic_shop();
  1145. #ifdef MAC
  1146. int store_buy();
  1147. #endif
  1148.  
  1149. /* signals.c */
  1150. void nosignals();
  1151. void signals();
  1152. void init_signals();
  1153. void ignore_signals();
  1154. void default_signals();
  1155. void restore_signals();
  1156.  
  1157. /* spells.c */
  1158. void monster_name();
  1159. void lower_monster_name();
  1160. int sleep_monsters1();
  1161. int detect_treasure();
  1162. int detect_object();
  1163. int detect_trap();
  1164. int detect_sdoor();
  1165. int detect_invisible();
  1166. int light_area();
  1167. int unlight_area();
  1168. void map_area();
  1169. int ident_spell();
  1170. int aggravate_monster();
  1171. int trap_creation();
  1172. int door_creation();
  1173. int td_destroy();
  1174. int detect_monsters();
  1175. void light_line();
  1176. void starlite();
  1177. int disarm_all();
  1178. void get_flags();
  1179. void fire_bolt();
  1180. void fire_ball();
  1181. void breath();
  1182. int recharge();
  1183. int hp_monster();
  1184. int drain_life();
  1185. int speed_monster();
  1186. int confuse_monster();
  1187. int sleep_monster();
  1188. int wall_to_mud();
  1189. int td_destroy2();
  1190. int poly_monster();
  1191. int build_wall();
  1192. int clone_monster();
  1193. void teleport_away();
  1194. void teleport_to();
  1195. int teleport_monster();
  1196. int mass_genocide();
  1197. int genocide();
  1198. int speed_monsters();
  1199. int sleep_monsters2();
  1200. int mass_poly();
  1201. int detect_evil();
  1202. int hp_player();
  1203. int cure_confusion();
  1204. int cure_blindness();
  1205. int cure_poison();
  1206. int remove_fear();
  1207. void earthquake();
  1208. int protect_evil();
  1209. void create_food();
  1210. int dispel_creature();
  1211. int turn_undead();
  1212. void warding_glyph();
  1213. void lose_str();
  1214. void lose_int();
  1215. void lose_wis();
  1216. void lose_dex();
  1217. void lose_con();
  1218. void lose_chr();
  1219. void lose_exp();
  1220. int slow_poison();
  1221. void bless();
  1222. void detect_inv2();
  1223. void destroy_area();
  1224. int enchant();
  1225. int remove_curse();
  1226. int restore_level();
  1227.  
  1228. /* staffs.c */
  1229. void use();
  1230.  
  1231. /* store1.c */
  1232. int32 item_value();
  1233. int32 sell_price();
  1234. int store_check_num();
  1235. void store_carry();
  1236. void store_destroy();
  1237. void store_init();
  1238. void store_maint();
  1239. int noneedtobargain();
  1240. void updatebargain();
  1241.  
  1242. /* store2.c */
  1243. void enter_store();
  1244.  
  1245. /* treasur1.c */
  1246.  
  1247. /* treasur2.c */
  1248.  
  1249. #ifdef VMS
  1250. /* uexit.c */
  1251. void uexit ();
  1252. #endif
  1253.  
  1254. #ifdef unix
  1255. /* unix.c */
  1256. int check_input();
  1257. #if 0
  1258. int system_cmd();
  1259. #endif
  1260. void user_name();
  1261. int tilde();
  1262. /* only declare this if stdio.h has been previously included, STDIO_LOADED
  1263.    is defined after stdio.h is included  */
  1264. #if defined(STDIO_LOADED)
  1265. FILE *tfopen();
  1266. #endif
  1267. int topen();
  1268. #endif
  1269.  
  1270. /* variable.c */
  1271.  
  1272. /* wands.c */
  1273. void aim();
  1274.  
  1275. /* wizard.c */
  1276. void wizard_light();
  1277. void change_character();
  1278. void wizard_create();
  1279.  
  1280. #endif
  1281.  
  1282. #ifdef unix
  1283. /* call functions which expand tilde before calling open/fopen */
  1284. #define open topen
  1285. #define fopen tfopen
  1286. #endif
  1287.  
  1288. /* st-stuff.c for the atari ST */
  1289. #if defined(atarist) && defined(__GNUC__)
  1290. extern char extended_file_name[80];
  1291. #endif
  1292.